/**
 * Copyright (C), 2015-2019, XXX有限公司
 * FileName: QQServiceProvider
 * Author:   zhouheng
 * Date:     2019/6/14 8:40
 * Description:
 * History:
 * <author>          <time>          <version>          <desc>
 * 作者姓名           修改时间           版本号              描述
 */
package com.zhouh.golden.security.social.qq.connect;

import com.zhouh.golden.common.constants.GoldenConstant;
import com.zhouh.golden.security.social.qq.api.QQ;
import com.zhouh.golden.security.social.qq.api.QQImpl;
import org.springframework.social.oauth2.AbstractOAuth2ServiceProvider;
import org.springframework.social.oauth2.OAuth2Operations;
import org.springframework.social.oauth2.OAuth2Template;

/**
 * 〈一句话功能简述〉<br> 
 * 〈〉
 *
 * @author zhouheng
 * @create 2019/6/14
 * @since 1.0.0
 */
public class QQServiceProvider extends AbstractOAuth2ServiceProvider<QQ> {

    private String appId;

    public QQServiceProvider(String appId, String appSecret) {
        super(new OAuth2Template(appId, appSecret, GoldenConstant.QQ_AUTHORIZE_URL, GoldenConstant.GET_QQ_ACCESSTOKEN_URL));
        this.appId = appId;
    }

    @Override
    public QQ getApi(String accessToken) {
        return new QQImpl(accessToken, appId);
    }
}